Dashboards

library(shiny)
library(flexdashboard)

Preliminaries

Nota Bene: The RStudio viewer does not display dashboards correctly. So use a web browser.

If your target is not a “normal”-size display (technical: 768 pixels or more in height), use the browser in emulation mode. - In Chrome, CMD-OPT-I brings up the console.

Flexdashboard

Set things up in YAML:

---
title: "Dashboard Value Boxes"
output:
  flexdashboard::flex_dashboard:
    orientation: rows
    navbar:
      - { title: "About", href: "https://example.com/about" }
      - { title: "StatPREP", href: "https//statprep.org"}
---

Layout

The navbar is described in the YAML. But everything else is ordinary headings.

flexdashboard::flex_dashboard() is an R/Markdown renderer that treats headings specially.

Attributes

Value boxes

spam <- 17
valueBox(
  spam, icon = "fa-trash",
  color = ifelse(spam > 10, "warning", "primary")
)

Icons from Font Awesome

1500+ free icons

                icon(“credit-card”)`   

Valid statuses

Essentially, a small library of colors intended to be use symantically:

Another dashboard format: <shinydashboard>

Unlike flexdashboards which is based on markdown, shinydashboard is based on the html-based construction kit that we used in fluidPage(), etc.

New elements:

Another format: Storyboards

I don’t see many of these, but they are straightforward.

YAML:

---
title: "A Walk through Wonderland"
output: 
  flexdashboard::flex_dashboard:
    storyboard: true
---

Storyboard items

Example: Projects/Project-5-dashboards/storyboard.Rmd